<?php

/*
 * Changing the status of a translation
 * 
 * @package BABEL
 * @since   BABEL 0.1.0
 * @version $Id: update_translations.php 766 2008-05-14 08:52:59Z bjori $
 * @copyright Copyright (C) 2008 Audun Skjelvan
 * @author  Audun Skjelvan
 * @license LGPL
 */

include('includes/babel/prepend_no_gui.php');

/*
 * SQL statement which updates a translated string in the database.
 *
 * 3params:
 * BABEL_TRANSLATE_STATUS_SUPERSEDED 	- What status to set the translation to
 * $_POST["value"] 						- The translated string
 * $_POST["editorId"]					- The translatiod if of the translation
 */
$DB_QUERY = "
			UPDATE
				babel_translations
			SET
				status = ?,
				translated_string = ?
			WHERE
				translation_id = ?
			";

//FIXME: error handling
PDODB::execQuery($DB_QUERY, array(BABEL_TRANSLATE_STATUS_APPROVED, $_POST["value"], $_POST["editorId"]));

echo($_POST["value"]);
?>
